From: Stuart Prescott Date: Sat, 15 Feb 2025 14:27:09 +0000 (+1100) Subject: Fix numpy header detection X-Git-Tag: archive/raspbian/6.11.2-2+rpi1^2^2~5 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=9d587773e0c0a6a3cfd63fe04731bdc5aed0a70f;p=pyside6.git Fix numpy header detection Existing code makes assumptions about site-packages/dist-packages and fails to find the headers; numpy has an explicit function for this Gbp-Pq: Name 0003-Fix-numpy-header-detection.patch --- diff --git a/build_scripts/utils.py b/build_scripts/utils.py index 3cb7ade0..c37d0870 100644 --- a/build_scripts/utils.py +++ b/build_scripts/utils.py @@ -77,17 +77,8 @@ def update_env_path(newpaths): def get_numpy_location(): - for p in sys.path: - if 'site-' in p: - numpy = Path(p).resolve() / 'numpy' - if numpy.is_dir(): - candidate = numpy / '_core' / 'include' # Version 2 - if not candidate.is_dir(): - candidate = numpy / 'core' / 'include' # Version 1 - if candidate.is_dir(): - return os.fspath(candidate) - log.warning(f"Cannot find numpy include dir under {numpy}") - return None + import numpy + return numpy.get_include() def platform_cmake_options(as_tuple_list=False):